package ThreadDome;

public class Dome4 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            for (int i = 0; i < 5; i++) {
                try{
                    Thread.sleep(1000);
                }catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("线程启动");
            }
        });
        t.start();
        try{
            Thread.sleep(6000);
        }catch(InterruptedException e){
            e.printStackTrace();
        }
        for (int i = 0; i < 5; i++) {
            System.out.println("main线程启动");
        }
    }
}
